package thread.safe;

public class Demo2 {
    static class Counter1 {
        public int count = 0;

        synchronized void increase1() {
            System.out.println("获取到第一把锁");
            increase2();
        }

        synchronized void increase2() {
            System.out.println("获取到内部锁");
            count++;
        }

    }

    public static void main(String[] args) {
        Counter1 counter1 = new Counter1();
        Thread t1 = new Thread(() -> {
            counter1.increase1();
        });
        t1.start();
    }
}
